<template>
    <div>
        <div class="bg">
            <img src="https://z3.ax1x.com/2021/11/04/IZQRIg.jpg" alt="">
        </div>
        <div class="login">
            <div class="left-login">
                <span>七里香</span>
                <span>说点什么吧~</span>
            </div>
            <div class="right-headpic">
                <img src="https://z3.ax1x.com/2021/11/07/I1aOEV.jpg" alt="">
            </div>
        </div>
        <div class="small-icon">
            <span class="iconfont icon-ring"></span>
            <span class="iconfont icon-sun"></span>
            <span class="iconfont icon-setup"></span>
        </div>
        <div class="listen-time">
            <img src="../assets/images/times.jpg" alt="">
            <div class="left-time">
                <span>0</span>
                <span>小时</span>
                <span>0</span>
                <span>分</span>
            </div>
            <div class="right-text">
                <span>收听时长</span>
            </div>
        </div>
        <div class="history">
            <ul>
                <li>
                    <div class="left-content">
                        <gm-collect>历史记录</gm-collect>
                    </div>
                    <div 
                    @click="showCollect"
                    class="right-content">
                        <gm-collect
                        >我的收藏</gm-collect>
                    </div>
                </li>
                <li>
                     <div class="left-content">
                        <gm-collect>我的下载</gm-collect>
                    </div>
                    <div class="right-content">
                    </div>
                </li>
            </ul>
        </div>

        <transition
            :duration="{ enter: 800, leave: 500 }"
            enter-active-class="animate__animated animate__fadeInRight"
            enter-to-class="animate__animated animate__fadeInRight"
            leave-active-class="animate__animated animate__fadeOutLeft"
            leave-to-class="animate__animated animate__fadeOutLeft"
    >
            <collect-detail v-if="show" @colseCollect="close"></collect-detail>
        </transition>
        
    </div>
</template>

<script>
import gmCollect from '@/components/gmCollect.vue'
import collectDetail from '@/pages/collect.vue'

export default {
    name: 'My',
    components: {
        gmCollect,
        collectDetail
    },
    data(){
        return {
            show: false,
        }
    },
    methods: {
        showCollect(){
            this.show = true;
        },
        close(val){
            this.show = val;
        }
    }
}
</script>

<style lang="scss" scoped>
$color: #DC912C;
.bg{
    width: 100%;
    height: 220px;
    img{
        width: 100%;
        height: 100%;
    }
}
.login{
    width: 340px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0;
    // transform: translateY(-80px);
    position: absolute;
    top: 140px;
    left: 18px;
    .left-login{
        width: 140px;
        span:first-child{
            display: block;
            font-size: 18px;
            font-weight: bold;
            letter-spacing: 2px;
            text-align: left;
            padding-bottom: 4px;
        }
        span:nth-child(2){
            display: block;
            font-size: 12px;
            color: #999;
            text-align: left;
        }
    }
    .right-headpic{
        width: 76px;
        border-radius: 50%;
        img{
            width: 100%;
            border-radius: 50%;
        }
    }
}
.small-icon{
    width: 120px;
    display: flex;
    justify-content: space-between;
    position: absolute;
    right: 16px;
    top: 22px;
    span{
        font-size: 24px;
        color: $color;
        opacity: .9;
    }
}
.listen-time{
    width: 340px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 36px 0;
    position: relative;
    box-sizing: border-box;
    img{
        width: 100%;
        height: 60px;
        position: absolute;
        z-index: -1;
        opacity: .3;
        border-radius: 6px;
    }
    .left-time{
        display: flex;
        align-items: center;
        span{
            padding-right: 12px;
        }
        span:nth-child(odd){
            font-size: 24px;
        }
        span:nth-child(even){
            font-size: 12px;
            vertical-align: middle;
            color: #666;
        }
    }
    .right-text{
        span{
            font-size: 14px;
            color: #666;
        }
    }
}
.history{
    ul{
        li{
            display: flex;
            justify-content: center;
            margin-bottom: 14px;
            .left-content{
                flex-basis: 40%;
                margin-right: 18px;
                flex-shrink: 0;
            }
            .right-content{
                flex-basis: 40%;
                flex-shrink: 0;
            }
        }
    }
}
</style>